{template header}
<style type="text/css">
    body{ background-color: #fff; }
    .sfz_box img{ max-height: 167px; }
    .ftime{ font-size: 12px; color: #999; }
    .fbox{ padding: 0 60px 0 10px }
    .fbox div{ background-color: #f7f7f7;border-radius: 5px; margin: 10px 0; padding: 10px; font-size: 14px; }
    textarea{ border:1px solid #eee; }
    .rbox{ padding: 0 10px 0 60px }
    .rbox .ftime{ text-align: right; }
    .rbox div{ background-color: #FEF8B4;border-radius: 5px; margin: 10px 0; padding: 10px; font-size: 14px; }
</style>
<script type="text/javascript">
    //字数限制
    window.onload = function() {
        $('#note2').keyup(function() {
            //    var val=$('#note2').val();
            //    var len=val.length;
            var len=this.value.length
            $('#text-count2').text(len);
        })
    }
</script>
<body>
    <!-- S header -->
    <header class="alliance_details_header">
        <a href="javascript:;" onClick="javascript :history.back(-1);" class="headerL iconfont">&#xe66a;</a>
        <h1>客服</h1>
    </header>
    <!-- E header -->
    


    <?php foreach($list as $key=>$val){?>
        <div class="fbox">
            
            <div>
                <p class="ftime">我的反馈：<?php echo date("Y-m-d H:i:s",$val['dateline'])?></p><?php echo $val['content']?>
            </div>
        </div>
        <div class="rbox">
            <div>
                <?php if($val['replytime']<1){?>

                <?php echo "暂无回复";}else{?>
                <p class="ftime">客服回复：<?php echo date("Y-m-d H:i:s",$val['replytime'])?></p><?php echo $val['reply']?>
                <?php }?>
            </div>
            
        </div>
        <div style="height: 10px; background-color: #eee;"></div>

    <?php }?>







    <div id="content">
        <textarea cols="40" rows="5" id="note2"
                  name="note2" maxlength="200" value=""
                  onkeyup="this.value=this.value.substring(0, 200)"
                  placeholder="请输入您的问题，我们将尽快给您回复"  class="service_textarea"></textarea>

        <div class="service_textarea_counter">
            <span id="text-count2" value="">0</span>/200
        </div>
    </div>
    <a href="javascript:;" id="sub"  class="service_affirm_btn" style="margin-top: 0;">确认</a>
</body>
<script>
    var is_click = false;
    $('#sub').click(function () {
        var txt = $('#note2').val();
        if($.trim(txt) == ''){
            hd_alert('请输入内容');
            return false;
        }
        if(is_click == true){
            return false;
        }
        is_click = true;
        $.ajax({
            url:"{U('feedback')}",
            dataType:'json',
            type:'post',
            data:{'txt':txt},
            success:function (res) {
                if (!parseInt(res.status)) {
                    hd_alert(res.info)
                    is_click = false;
                    return false;
                } else {
                    hd_alert(res.info,2,res.url)
                }
            }
        })
    })
</script>
</html>